<template>
  <view class="state-page bg-white flex justify-center">
    <view class="margin-larger-xxl">
      <textarea class="shadow-xl  p-4 rounded-md" :value="txtContent"></textarea>
      <view class="text-blue-500 bold p-2" @click="openRichText">打开富文本预览</view>
      <view class="text-slate-500 bold p-2" @click="editRichText">编辑富文本</view>
    
    </view>
  </view>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      mode: "date",
      title: "状态",
      txtContent: '<p>富文本测试<span style="font-size: 14px;">😃</span></p><p><img src="https://img0.baidu.com/it/u=2252108510,1256656495&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=800&amp;h=500" style="max-width:100%;" contenteditable="false"/></p><p>5555<b>555<font color="#f9963b">555555</font><span style="background-color: rgb(194, 79, 74);">5555555</span></b></p><table border="0" width="100%" cellpadding="0" cellspacing="0"><tbody><tr><th>1</th><th>2</th></tr><tr><td>3</td><td>4</td></tr></tbody></table><p><br/></p><ul class="w-e-todo"><li><span contenteditable="false"><input type="checkbox"/></span>eeee</li></ul><ul class="w-e-todo"><li><span contenteditable="false"><input type="checkbox"/></span>qqqq</li></ul><ul class="w-e-todo"><li><span contenteditable="false"><input type="checkbox"/></span>www</li></ul>'
    };
  },
  onLoad: function () {
    this.openRichText();
  },
  methods: {
    openRichText() {
      // uni.redirectTo
      uni.navigateTo({
        url: `/pages/subHome/public/richTextPage/richTextPage`,
        success: (res) => {
          res.eventChannel.emit('richText', {
            title: "富文本页面",
            data: this.txtContent
          });
        }
      });
    },
   editRichText() {

    }
  }
};
</script>
<style lang='scss' scoped></style>
